/**
 * @author 老刘
 * @desc 个人中心
 */
import { go } from '../../../utils/util.js';
Page({
	data: {
		personalCenterList: [
			{title: '天气', ico: 'weather', url: 'weather'},
			{title: '关于', ico: 'about', url: 'about'},
			{title: '联系作者', ico: 'contact', url: 'contact_author', info: '回复\'6\'联系作者'},
			{title: '获取源码', ico: 'contact', url: 'get_source_code', info: '回复\'1\'获取源码'},
			{title: '版本记录', ico: 'version', url: 'release_notes'}
		],
		showContactAuthor: false,
		contentInfo: ''
	},
	onLoad () {
	},
	handleGo (e) {
		const url = e.currentTarget.dataset.url;
		const urlList = ['contact_author', 'get_source_code'];
		if (urlList.includes(url)) {
			const info = e.currentTarget.dataset.info;
			this.setData({
				contentInfo: info,
				showContactAuthor: true
			});
			return;
		}
		go(`/pages/personal_center/${url}/${url}`);
	},
	handleContactAuthorClose () {
		this.setData({
			showContactAuthor: false
		});
	}
});
